from typing import Generic, TypeVar

from zkl_pyutils_registries.basics import Matcher, NotMatched

T = TypeVar('T')


class ObjectMatcher(Matcher[T, T, int], Generic[T]):
    def match(self, query: T, value: T) -> int:
        if query is value:
            return 2
        if query == value:
            return 1
        raise NotMatched
